Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh: (helm) - add annotation to wait for all resources to be deleted before removing CR finalizer #4487

Merged
merged 3 commits into from
Apr 12, 2021

Conversation

mikeshng
Copy link
Contributor

@mikeshng mikeshng commented Feb 4, 2021

Signed-off-by: Mike Ng ming@redhat.com

Description of the change:
For Helm based-operators, added annotation helm.sdk.operatorframework.io/uninstall-wait: "true" option to allow all resources to be deleted before removing the custom resource's finalizer.

Motivation for the change:
Closes #4401

Checklist

If the pull request includes user-facing changes, extra documentation is required:

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 7, 2021
…before removing finalizer

Signed-off-by: Mike Ng <ming@redhat.com>
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 9, 2021
For Helm based-operators, added annotation `helm.sdk.operatorframework.io/uninstall-wait: "true"`
to allow all resources to be deleted before removing the custom resource's finalizer.
kind: "addition"
breaking: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit : space at the end of the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Done as suggested.

_ = r.updateResourceStatus(ctx, o, status)
return reconcile.Result{}, err
}
if !areAllResDeleted {
Copy link
Contributor

@camilamacedo86 camilamacedo86 Mar 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if !areAllResDeleted {
if !isAllResourcesDeleted {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Done as suggested.

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is very completed. It is a great work has docs, changelogs and tests 🥇
I am ok with the change. Just added a nit suggestion.

However, would be nice check with @joelanford or any other team member before we add this one.
Otherwise /lgtm

status.RemoveCondition(types.ConditionReleaseFailed)
}

log.Info("Removing finalizer")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@mikeshng mikeshng temporarily deployed to deploy March 9, 2021 14:34 Inactive
@estroz estroz self-assigned this Apr 5, 2021
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, just one potential bugfix

internal/helm/release/manager.go Show resolved Hide resolved
internal/helm/release/manager.go Outdated Show resolved Hide resolved
internal/helm/release/manager.go Outdated Show resolved Hide resolved
…ction

Signed-off-by: Mike Ng <ming@redhat.com>
Copy link
Member

@estroz estroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mikeshng!

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 12, 2021
@estroz estroz merged commit 45273ba into operator-framework:master Apr 12, 2021
@mikeshng mikeshng deleted the enh-helm-uninstall branch April 14, 2021 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
4 participants